package com.xjh.utils.beanutils.annotation;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Bean复制集合
 *
 * @company 湖南省安第斯信息科技有限公司, 版权所有
 * @author kevin
 * @date 2021/3/10
 */
@Retention(RUNTIME)
@Target(FIELD)
@Documented
public @interface CopyCollection {

	/**
	 * The property name in source object that want to be copied from.
	 * <p>Note: </p>
	 * <pre> "" (empty string, or null): means the property name is same to source object. 
	 * a.b: means the source value is coming from source object's property a's property b. </pre>
	 * @return the property name which will be copied from.
	 */
	String property() default "";
	
	/**
	 * Specify this property will be ignored when do bean copy.
	 * @return true is ignored.
	 */
	boolean ignored() default false;
	
	/**
	 * Specify the collection's template class type.
	 * @return The colleciton's template class type.
	 */
	Class<?> targetClass();
	
	/**
	 * Specify the optionClass when coping when targetClass is a Java bean class.
	 * @return option class.
	 */
	Class<?> optionClass() default void.class;
}
